package com.dgj.sigar.gathers;

import org.hyperic.sigar.Mem;
import org.hyperic.sigar.Sigar;
import org.hyperic.sigar.SigarException;
import org.hyperic.sigar.Swap;

public class MemoryGather {
	private Mem memory;
	private Swap swap;
	

	public Mem getMemory() {
		return memory;
	}

	public Swap getSwap() {
		return swap;
	}

	public static MemoryGather init(Sigar sigar) {
		MemoryGather gather = new MemoryGather();
		try {
			gather.memory = sigar.getMem();
			gather.swap = sigar.getSwap();
		} catch (SigarException e) {
			e.printStackTrace();
		}
		return gather;
	}

}
